# coding:utf-8

import os
import urllib

host = 'https://cxkjsms.market.alicloudapi.com'
path = '/chuangxinsms/dxjk'
method = 'POST'
appcode = 'f277f6cea3b74f30a50bfaee79858ef6'


def send_sms(content, mobile):
    format_content = {
        "content": content,
        "mobile": mobile
    }
    data = urllib.urlencode(format_content)
    url = host + path + '?' + data
    print (url)
    sms_command = """curl -i -k -X POST '%s'  -H 'Authorization:APPCODE %s'""" % (url, appcode)
    os.system(sms_command)


# 测试可用默认短信模板,测试模板为专用模板不可修改,如需自定义短信内容或改动任意字符,请联系旺旺或QQ726980650进行申请
# send_sms("【量化提醒】buy_code: 123456,buy_amount: 12345678.91", "15300876878")
